package com.acsior.hibernate.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernatePersistantIntegerIdVO;

/**
 * CustomerDiscount entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "customer_discounts", uniqueConstraints = @UniqueConstraint(columnNames = {
		"registered_customer_id", "nom_discount_type_id" }))
@GeneratorKey(tableName = "customer_discounts")
public class CustomerDiscountVO extends HibernatePersistantIntegerIdVO {

	private static final long serialVersionUID = 5516626668490814288L;

	@Column(name = "discount", nullable = false)
	private Integer discount;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_discount_type_id", nullable = false)
	private NomDiscountTypeVO nomDiscountType;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "registered_customer_id", nullable = false)
	private RegisteredCustomerVO registeredCustomer;

	/** default constructor */
	public CustomerDiscountVO() {
		super();
	}

	/** @return the discount */
	public Integer getDiscount() {
		return this.discount;
	}

	/** @return the nomDiscountType */
	public NomDiscountTypeVO getNomDiscountType() {
		return this.nomDiscountType;
	}

	/** @return the registeredCustomer */
	public RegisteredCustomerVO getRegisteredCustomer() {
		return this.registeredCustomer;
	}

	/**
	 * @param discount
	 *            the discount to set
	 */
	public void setDiscount(Integer discount) {
		this.discount = discount;
	}

	/**
	 * @param nomDiscountType
	 *            the nomDiscountType to set
	 */
	public void setNomDiscountType(NomDiscountTypeVO nomDiscountType) {
		this.nomDiscountType = nomDiscountType;
	}

	/**
	 * @param registeredCustomer
	 *            the registeredCustomer to set
	 */
	public void setRegisteredCustomer(RegisteredCustomerVO registeredCustomer) {
		this.registeredCustomer = registeredCustomer;
	}

}